<?php

if (Layout::o()->enabled('main_menu')) {

////////////////////////////////////////////////////////////////////////////////

$items_ref =& Layout::o()->widget['menu']->getByTags(array('main'));

if (count($items_ref)) {

    $num    = 0;
    $cells  = array();
    foreach ($items_ref as $item) {
        $add_class = ' class="sys_clear item-wrpper '.($item->active ? 'active' : 'inactive').'"';
        $str = "";
        $str .= '<td'.$add_class.'>';
        $str .= '<div class="item">';
        if ($item->active && $item->current) {
            $str .= $item->title;
        } else {
            $str .= '<a href="'.$html->url($item->url_with_params).'">'.$item->title.'</a>';
        }
        $str .= '</div>';
        $str .= '</td>';
        $cells[] = $str;
        $num++;
    }

        ?><table id="menu" cellpadding="0" class="sys_layout"><?php
        ?><tr class="sys_clear"><?php
        ?><td id="menu-prefix" class="sys_clear"><?php
       /* ?><div>&nbsp;</div><?php*/
        ?></td><?php
        foreach ($cells as $cell) {
            ?><?=$cell;?><?php
        }
        ?></tr><?php
        ?></table><?php
}

}

?>
